<template>
  <div>
    <p>{{ sex }}</p>
    <button @click="change">{{ msg }}</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      sex: "女",
      msg: "0",
    };
  },

  created() {},

  methods: {
    change() {
      // if(this.sex === '女'){
      //   this.msg = 1
      //   this.sex = '男'
      // } else {
      //   this.msg = 0
      //   this.sex = '女'
      // }
      this.msg = this.msg === 1 ? 0 : 1;
      this.sex = this.sex === "男" ? "女" : "男";
    },
  },
};
</script>

<style scoped lang='less'>
</style>
